
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>添加菜单</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="/static/layui/css/layuic.css" media="all" />
	<style>
		.layui-anim-upbit {
			width: 350px;
		}
	</style>
</head>
<body class="childrenBody">
<form class="layui-form" action="" lay-filter="component-form-element">
	<div class="layui-form-item">
		<input type="hidden" id="roleId" name="id">
	</div>
	<div class="layui-form-item">
		<div class="layui-col-lg6">
			<label class="layui-form-label">角色名称：</label>
			<div class="layui-input-inline">
				<input type="text" name="name" id="name" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" value="">
			</div>
		</div>
	</div>

    <div class="layui-row layui-col-space10 layui-form-item">
        <div class="layui-col-lg6">
            <label class="layui-form-label">是否启用：</label>
            <div class="layui-input-block">
                <input checked="" name="useable" id="useable" lay-skin="switch" lay-filter="switchTest" type="checkbox" lay-text="是|否">
            </div>
        </div>
    </div>
	<div class="layui-form-item">
		<label class="layui-form-label">选择权限：</label>
		<div class="layui-input-block">
			<button type="button" class="layui-btn layui-btn-primary" onclick="checkAll('#LAY-auth-tree-index')">全选</button>
			<button type="button" class="layui-btn layui-btn-primary" onclick="uncheckAll('#LAY-auth-tree-index')">全不选</button>
			<button type="button" class="layui-btn layui-btn-primary" onclick="showAll('#LAY-auth-tree-index')">全部展开</button>
			<button type="button" class="layui-btn layui-btn-primary" onclick="closeAll('#LAY-auth-tree-index')">全部隐藏</button>
		</div>
		<div class="layui-input-block">
			<div id="LAY-auth-tree-index"></div>
		</div>
	</div>

	<div class="layui-form-item">
		<div class="layui-input-block">
			<button class="layui-btn" lay-submit lay-filter="edit">提交修改</button>
			<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
	</div>
</form>
<script type="text/javascript" src="/static/layui/layui.js"></script>
<script src="/static/layui/mymodule/common.js"></script>
<script type="text/javascript" src="/static/js/user_power/sys_role/roleEdit.js"></script>
<script type="text/javascript">

    // 全选样例
    function checkAll(dst){
        layui.use(['jquery', 'layer', 'authtree'], function(){
            var layer = layui.layer;
            var authtree = layui.authtree;

            authtree.checkAll(dst);
        });
    }
    // 全不选样例
    function uncheckAll(dst){
        layui.use(['jquery', 'layer', 'authtree'], function(){
            var layer = layui.layer;
            var authtree = layui.authtree;

            authtree.uncheckAll(dst);
        });
    }
    // 显示全部
    function showAll(dst){
        layui.use(['jquery', 'layer', 'authtree'], function(){
            var layer = layui.layer;
            var authtree = layui.authtree;

            authtree.showAll(dst);
        });
    }
    // 隐藏全部
    function closeAll(dst){
        layui.use(['jquery', 'layer', 'authtree'], function(){
            var layer = layui.layer;
            var authtree = layui.authtree;

            authtree.closeAll(dst);
        });
    }
</script>
</body>
</html>